
package com.english.service.impl;

import java.util.List;

import com.english.service.impl.BaseManager;
import com.english.model.Category;
import com.english.dao.CategoryDao;
import com.english.service.CategoryManager;

public class CategoryManagerImpl extends BaseManager implements CategoryManager {
    private CategoryDao dao;

    /**
     * Set the Dao for communication with the data layer.
     * @param dao
     */
    public void setCategoryDao(CategoryDao dao) {
        this.dao = dao;
    }

    /**
     * @see com.english.service.CategoryManager#getCategorys(com.english.model.Category)
     */
    public List getCategorys(final Category category) {
        return dao.getCategorys(category);
    }

    /**
     * @see com.english.service.CategoryManager#getCategory(String id)
     */
    public Category getCategory(final String id) {
        return dao.getCategory(new Long(id));
    }

    /**
     * @see com.english.service.CategoryManager#saveCategory(Category category)
     */
    public void saveCategory(Category category) {
        dao.saveCategory(category);
    }

    /**
     * @see com.english.service.CategoryManager#removeCategory(String id)
     */
    public void removeCategory(final String id) {
        dao.removeCategory(new Long(id));
    }
}
